<template>
  <div class="ali-pay">
    <loading v-if="loading"></loading>
    <div class="form" v-html="content"></div>
  </div>
</template>

<script>
import {paySubmit} from "@/api/user";
import Loading from "@/components/common/Loading/Loading";

export default {
  name: "aliPay",
  components: {Loading},
  data() {
    return {
      orderId: this.$route.query.orderId,
      content: '',
      loading: true
    }
  },
  mounted() {
    this.paySubmit()
  },
  methods: {
    paySubmit() {
      let order = {
        orderId: this.orderId,
        orderName: 'vue高仿小米商城',
        amount: '0.01',
        payType: 1,
      }
      paySubmit(order).then(res => {
        this.content = res.content;
        /*setTimeout(()=>{
          document.forms[0].submit()
        },100)*/
      })
    }
  }
}
</script>

<style scoped>

</style>
